/* $Id: UserDomainObjectManagerImpl.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.domain.manager.provider;

import java.util.Collection;
import java.util.List;

import ae.pcfc.etks.online.common.dao.UserDAO;
import ae.pcfc.etks.online.common.domain.User;
import ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager;
import ae.pcfc.etks.online.common.exception.LookupException;
import ae.pcfc.etks.online.common.exception.PersistenceException;
import ae.pcfc.etks.online.common.vo.PagingVO;

public class UserDomainObjectManagerImpl implements UserDomainObjectManager {

	private UserDAO userDAO;

	/**
	 * setUserDAO
	 * 
	 * @param userDAO
	 * void
	 */
	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	/**
	 * add
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#add(java.lang.Object)
	 * 
	 */
	public <T> void add(T obj) throws PersistenceException {
		
		this.userDAO.add((User) obj);

	}

	/**
	 * update
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#update(java.lang.Object)
	 * 
	 */
	public <T> void update(T obj) throws PersistenceException {
		
		this.userDAO.update((User) obj);

	}

	/**
	 * delete
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#delete(java.lang.Object)
	 * 
	 */
	public <T> void delete(T obj) throws PersistenceException {
		// TODO Auto-generated method stub

	}

	/**
	 * findByPrimaryKey
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#findByPrimaryKey(java.lang.String)
	 * 
	 */
	public <T> T findByPrimaryKey(String id) throws LookupException {
		return (T) this.userDAO.finByPrimaryKey(Long.valueOf(id));
	}

	/**
	 * findAll
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.BaseDomainObjectManager#findAll()
	 * 
	 */
	public <T> Collection<T> findAll() throws LookupException {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * findUserByUserName
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findUserByUserName(java.lang.String)
	 * 
	 */
	public User findUserByUserName(String userName) {

		return this.userDAO.findUserByUserName(userName);
	}

	/**
	 * getUserList
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#getUserList()
	 * 
	 */
	public List<User> getUserList() {

		return this.userDAO.getUserList();
	}

	/**
	 * getUserListByPagingParameters
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#getUserListByPagingParameters(ae.pcfc.etks.online.common.vo.PagingVO)
	 * 
	 */
	public List<User> getUserListByPagingParameters(PagingVO pagingVO) {

		return this.userDAO.getUserListByPagingParameters(pagingVO);
	}

	/**
	 * findUserByEmail
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findUserByEmail(java.lang.String)
	 * 
	 */
	public User findUserByEmail(String email) {
		
		return this.userDAO.getUserByEmail(email);
	}

	/**
	 * findUserByEmailExceptCurrentUser
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findUserByEmailExceptCurrentUser(java.lang.String, java.lang.Long)
	 * 
	 */
	public User findUserByEmailExceptCurrentUser(String strEmail,
			Long lUserId) {
		// TODO Auto-generated method stub
		return this.userDAO.findUserByEmailExceptCurrentUser(strEmail, lUserId);
	}
	/**
	 * findUserByEmailExceptCurrentCompany
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findUserByEmailExceptCurrentCompany(java.lang.String, java.lang.String)
	 * 
	 */
	public User findUserByEmailExceptCurrentCompany(String strEmail,
			String strTrakheesId){
		return this.userDAO.findUserByEmailExceptCurrentCompany(strEmail, strTrakheesId);
	}
	/**
	 * findUsersByTrakheesId
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findUsersByTrakheesId(java.lang.String)
	 * 
	 */
	public List<User> findUsersByTrakheesId(String strTrakheesId){
		return this.userDAO.findUsersByTrakheesId(strTrakheesId);
	}

	/**
	 * findClientAdminByTrakheesId
	 * 
	 * @see ae.pcfc.etks.online.common.domain.manager.UserDomainObjectManager#findClientAdminByTrakheesId(java.lang.String)
	 * 
	 */
	public User findClientAdminByTrakheesId(String strTrakheesId) {
		return this.userDAO.findClientAdminByTrakheesId(strTrakheesId);
	}
}
